- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 8.9k
fix(compiler-vapor): fix asset import from public directory #13630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: minor
Are you sure you want to change the base?
Conversation
| Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the  You can disable this status message by setting the  ✨ Finishing touches🧪 Generate unit tests (beta)
 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment  | 
| Size ReportBundles
 Usages
 | 
| @vue/compiler-core
 @vue/compiler-dom
 @vue/compiler-sfc
 @vue/compiler-ssr
 @vue/compiler-vapor
 @vue/reactivity
 @vue/runtime-core
 @vue/runtime-dom
 @vue/runtime-vapor
 @vue/server-renderer
 @vue/shared
 vue
 @vue/compat
 commit:  | 
        
          
                packages/compiler-vapor/__tests__/__snapshots__/compile.spec.ts.snap
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | Hi! @edison1105 This change breaks the existing unit tests because previous snapshots were based on template strings wrapped with double quotes. I'm not sure whether this change might break anything else beyond the existing tests, so I’d appreciate your review and feedback before proceeding further. | 
| The current implementation of this PR still has the following issues: 
 interface IREffect {
  // Here, `expressions` was previously considered to only be `SimpleExpressionNode` in its type.
  expressions: (SimpleExpressionNode | CompoundExpressionNode)[]
  operations: OperationNode[]
}Therefore, for  Thus,  
 | 
| Thanks for your response @ShenQingchuan! I’ve also encountered this with assetURLs. Since  export interface IRProp extends Omit<DirectiveTransformResult, 'value'> {
  values: SimpleExpressionNode[]
}…it becomes tricky to support cases like: <use href="~@svg/file.svg#fragment"></use>In this case, the prop value is actually  I’m currently trying to work around this, though it’s a bit challenging for me. | 
| ❌ Deploy Preview for vue-sfc-playground failed. Why did it fail? →
 | 
Problem statement
See #13623.
Change summary
Add
importsfor TransformContext in compiler-vapor.Modify expression generator to treat the expression of imported public asset properly.
Generate asset imports.
Closes #13623.